home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / LROTL.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  405 b   |  17 lines

  1. /*irotl function, from p. 222 of turboc bible */
  2. #include<stdio.h>
  3. #include<stdlib.h>
  4. main()
  5. {
  6.     char input[80];
  7.     int bits;
  8.     unsigned long value;
  9.     char **eptr;
  10.  
  11.     printf("enter long integer to rotate (in hex):");
  12.     gets(input);
  13.     value = strtoul(input, eptr, 16);
  14.     for(bits = 1; bits < 33; bits++)
  15.     printf("%#8.8lx roteted left by %dd bits = %#8.8lx\n",
  16.         value, bits, _lrotl(value, bits));
  17. }